1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 25 module gtk.SymbolicPaintableT; 26 27 public import gdk.RGBA; 28 public import gdk.Snapshot; 29 public import gtk.c.functions; 30 public import gtk.c.types; 31 32 33 /** 34 * `GtkSymbolicPaintable` is an interface that support symbolic colors in 35 * paintables. 36 * 37 * `GdkPaintable`s implementing the interface will have the 38 * [vfunc@Gtk.SymbolicPaintable.snapshot_symbolic] function called and 39 * have the colors for drawing symbolic icons passed. At least 4 colors are guaranteed 40 * to be passed every time. 41 * 42 * These 4 colors are the foreground color, and the colors to use for errors, warnings 43 * and success information in that order. 44 * 45 * More colors may be added in the future. 46 * 47 * Since: 4.6 48 */ 49 public template SymbolicPaintableT(TStruct) 50 { 51 /** Get the main Gtk struct */ 52 public GtkSymbolicPaintable* getSymbolicPaintableStruct(bool transferOwnership = false) 53 { 54 if (transferOwnership) 55 ownedRef = false; 56 return cast(GtkSymbolicPaintable*)getStruct(); 57 } 58 59 60 /** 61 * Snapshots the paintable with the given colors. 62 * 63 * If less than 4 colors are provided, GTK will pad the array with default 64 * colors. 65 * 66 * Params: 67 * snapshot = a `GdkSnapshot` to snapshot to 68 * width = width to snapshot in 69 * height = height to snapshot in 70 * colors = a pointer to an array of colors 71 * 72 * Since: 4.6 73 */ 74 public void snapshotSymbolic(Snapshot snapshot, double width, double height, RGBA[] colors) 75 { 76 GdkRGBA[] colorsArray = new GdkRGBA[colors.length]; 77 for ( int i = 0; i < colors.length; i++ ) 78 { 79 colorsArray[i] = *(colors[i].getRGBAStruct()); 80 } 81 82 gtk_symbolic_paintable_snapshot_symbolic(getSymbolicPaintableStruct(), (snapshot is null) ? null : snapshot.getSnapshotStruct(), width, height, colorsArray.ptr, cast(size_t)colors.length); 83 } 84 }